var map = [
	{
		enemies : [ 
			new EasyEnemy(),
			new EasyEnemy(),
			new EasyEnemy(),
			new EasyEnemy(),
//			new EasyEnemy() , new HardEnemy() , new FastEnemy() , new NormalEnemy() ,
//			new EasyEnemy() , new HardEnemy() , new FastEnemy() , new NormalEnemy() ,
//			new EasyEnemy() , new HardEnemy() , new FastEnemy() , new NormalEnemy() ,
		],
		bricks : [],
		steels : [],		
	},
	{
		enemies : [ 
			new EasyEnemy() , new HardEnemy() , new FastEnemy() , new NormalEnemy() ,
			new EasyEnemy() , new HardEnemy() , new FastEnemy() , new NormalEnemy() ,
			new EasyEnemy() , new HardEnemy() , new FastEnemy() , new NormalEnemy() ,
			new EasyEnemy() , new HardEnemy() , new FastEnemy() , new NormalEnemy() ,
			new EasyEnemy() , new HardEnemy() , new FastEnemy() , new NormalEnemy() ,
		],
		bricks : [],
		steels : [],		
	},
	{
		enemies : [ 
			new EasyEnemy() ,  new FastEnemy() , new NormalEnemy() ,new HardEnemy() ,
//			 new HardEnemy() ,new EasyEnemy() , new FastEnemy() , new NormalEnemy() ,
//			new EasyEnemy() , new HardEnemy() ,  new NormalEnemy() ,new FastEnemy() ,
//			 new HardEnemy() , new FastEnemy() , new NormalEnemy() ,new EasyEnemy() ,
//			 new HardEnemy() , new FastEnemy() ,new EasyEnemy() , new NormalEnemy() ,
		],
		bricks : [],
		steels : [],
	}
]
/**
 * 第一关地图
 */
Brick.addCol( map[0].bricks , 2  ,2 ,14 ,3  );
Brick.addCol( map[0].bricks , 7 ,2 ,14 ,3  );

Brick.addCol( map[0].bricks , 12 ,2 ,12 ,3 );
Brick.addCol( map[0].bricks , 17 ,2 ,12 ,3 );

Brick.addCol( map[0].bricks , 22 ,2 ,14 ,3 );
Brick.addCol( map[0].bricks , 28 ,2 ,14 ,3 );

Brick.addRow( map[0].bricks , 12 ,16,3 );
Brick.addRow( map[0].bricks , 17 ,16,3 );

Brick.addRow( map[0].bricks , 75  ,18,5 );
Brick.addRow( map[0].bricks , 22 ,18,5 );

Brick.addCol( map[0].bricks , 2  ,22 ,8 ,3  );
Brick.addCol( map[0].bricks , 7 ,22 ,8 ,3  );

Brick.addCol( map[0].bricks , 12 ,20 ,6 ,3 );
Brick.addCol( map[0].bricks , 17 ,20 ,6 ,3 );

Brick.addCol( map[0].bricks , 22 ,22 ,8 ,3 );
Brick.addCol( map[0].bricks , 28 ,22 ,8 ,3 );

Steel.addRow( map[0].steels , 15 ,6  ,2 );
Steel.addRow( map[0].steels , 0   ,19 ,2 ,1);
Steel.addRow( map[0].steels , 31 ,19 ,2 ,1);

/**
 * 第二关地图
 * x,y,length,width
 */
/*
Brick.addCol( map[1].bricks , 0  ,4 ,2 );
Brick.addCol( map[1].bricks , 8  ,0 ,4 );

Brick.addCol( map[1].bricks , 12 ,8 ,4 );
Brick.addCol( map[1].bricks , 14 ,6 ,3 );
Brick.addCol( map[1].bricks , 18 ,6 ,4 );
Brick.addCol( map[1].bricks , 23 ,8 ,4 ,1);
Brick.addCol( map[1].bricks , 23 ,8 ,4 ,1);

Brick.addCol( map[1].bricks , 20 ,8 ,4 );
Brick.addCol( map[1].bricks , 22 ,8 ,4 );
Brick.addCol( map[1].bricks , 24 ,8 ,4 );

Brick.addRow( map[1].bricks , 0 ,16 ,3 );
Brick.addRow( map[1].bricks , 5 ,16 ,4 );
Brick.addRow( map[1].bricks , 11 ,16 ,1 );
Brick.addRow( map[1].bricks , 12 ,16 ,6,1 );
Brick.addRow( map[1].bricks , 10 ,18 ,6 );
Brick.addRow( map[1].bricks , 14 ,19 ,4 );
Brick.addRow( map[1].bricks , 18 ,24 ,10 );

Brick.addRow( map[1].bricks , 2 ,15 ,2 );
Brick.addRow( map[1].bricks , 2 ,17 ,2 );
Brick.addRow( map[1].bricks , 8 ,8 ,4 );
Brick.addRow( map[1].bricks , 20 ,6 ,3 );

Steel.addRow( map[1].steels , 20 ,3 , 10,1 );
Steel.addRow( map[1].steels , 12 ,12 ,6 );
Steel.addRow( map[1].steels , 0 ,24 ,2 );

Steel.addCol( map[1].steels , 24 ,19 ,4,1 );
*/
for(var mi = 1 ; mi < 100; mi++){
	
	for(var i = 0 ;i < 30 ;i++){
		Brick.addRow( map[mi].bricks , 
			parseInt( Math.random() * 31 ) ,
			parseInt( Math.random() * 29 ) + 2  ,
			parseInt( Math.random() * 4 ), 
			parseInt( Math.random() * 2 ) );
		Brick.addCol( map[mi].bricks ,
			parseInt( Math.random() * 31 ) ,
			parseInt( Math.random() * 29 ) + 2  ,
			parseInt( Math.random() * 4 ), 
			parseInt( Math.random() * 2 ) );
		
	}
	for(var i = 0 ;i < 8 ;i++){
		Steel.addRow( map[mi].steels , 
			parseInt( Math.random() * 31 ) ,
			parseInt( Math.random() * 29 ) + 2  ,
			parseInt( Math.random() * 4 ), 
			parseInt( Math.random() * 2 ) );
		Steel.addCol( map[mi].steels , 
			parseInt( Math.random() * 31 ) ,
			parseInt( Math.random() * 29 ) + 2  ,
			parseInt( Math.random() * 4 ), 
			parseInt( Math.random() * 2 ) );
	}
	for(var i = 0 ;i < 18 ;i++){
		switch( parseInt( Math.random() * 4 ) ){
			case 0:
				map[mi].enemies.push( new EasyEnemy() );
				break;
			case 1:
				map[mi].enemies.push( new NormalEnemy() );
				break;
			case 2:
				map[mi].enemies.push( new HardEnemy() );
				break;
			case 3:
				map[mi].enemies.push( new FastEnemy() );
				break;
		}
	}
}